#ifndef CURVE_FITTING_EDGE_H
#define CURVE_FITTING_EDGE_H

#include "curve_fitting_vertex.h"
#include <g2o/core/base_unary_edge.h>

class CurveFittingEdge : public g2o::BaseUnaryEdge<1, double, CurveFittingVertex>
{
public:
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW

    CurveFittingEdge(double x) : BaseUnaryEdge(), _x(x) {}

    virtual void computeError() override;
    virtual void linearizeOplus() override;

    virtual bool read(istream &in) override { return false; }
    virtual bool write(ostream &out) const override { return false; }

public:
    double _x;
};

#endif
